<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // reverse方法用于颠倒排列数组元素，返回改变后的数组。该方法会改变原数组。
        var num = [1,2,3,4,5,6]
        num.reverse();
        console.log(num);
        //实现一盒字符串的反转排列：将gaoweijie——>eijiewoag
        var index = "gaoweijie"
        var index1 =index.split('');
        index1.reverse();
        console.log(index1.join(''));
         
    </script>
</body>
</html>